<%@ page import="myschool.service.SubjectService" %>
<%@ page import="myschool.entity.Subject" %>
<%@ page import="java.util.List" %>
<%@ page import="myschool.service.GradeService" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>超市账单管理系统</title>
    <link rel="stylesheet" href="../css/public.css"/>
    <link rel="stylesheet" href="../css/style.css"/>
</head>
<body>
<!--时间-->

<!--主体内容-->
<section class="publicMian ">
    <div class="right">
        <div class="location">
            <strong>你现在所在的位置是:</strong>
            <span>课程信息管理</span>
        </div>
        <div class="search">
            <form action="../doSubjectSearch.jsp">
                <input type="text" name="searh">
                <input type="submit" value="查询"/>
                <a href="../subjectAdd.jsp">添加新课程</a>
            </form>
        </div>
        <!--账单表格 样式和供应商公用-->
        <table class="providerTable" cellpadding="0" cellspacing="0">
            <tr class="firstTr">
                <th width="10%">科目编号</th>
                <th width="20%">科目名称</th>
                <th width="10%">学时</th>
                <th width="10%">年级名称</th>
                <th width="30%">操作</th>
            </tr>
            <%
                List<Subject> subject = SubjectService.ME.findALL(1, 10);
                for (Subject s : subject) {%>
            <tr>
                <td><%=s.getId()%>
                </td>
                <td><%=s.getSubjectname()%>
                </td>
                <td><%=s.getClasshour()%>
                </td>
                <td><%=GradeService.ME.find(s.getGradeid()).getName()%>
                </td>
                <td>
                    <a href="billView.html"><img src="../img/read.png" alt="查看" title="查看"/></a>
                    <a href="../subjectUpdate.jsp?id=<%=s.getId()%>"><img src="../img/xiugai.png" alt="修改" title="修改"/></a>
                    <a href="../subjectDelete.jsp?id=<%=s.getId()%>" onclick="return confirm('请确认是否删除次科目？')" class="removeBill"><img src="../img/schu.png" alt="删除" title="删除"/></a>
                </td>
            </tr>
            <%}%>
        </table>
    </div>
</section>

</body>
</html>